package com.baizhi.controller;

import com.baizhi.entity.CmfzAlbum;
import com.baizhi.service.CmfzAlbumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * @Author: renpu
 * @Date: 2019/2/27 13:41
 * @Description:
 */
@Controller
@RequestMapping("/Album")
public class CmfzAlbumController {
    @Autowired
    private CmfzAlbumService albumService;

    @RequestMapping("/showAlbum")
    @ResponseBody
    public Map showAlbum(int rows,int page){
        return albumService.selectByPage(rows,page);
    }

    @RequestMapping("/addAlbum")
    public void addAlbum(CmfzAlbum album){
        albumService.insert(album);
    }

    @RequestMapping("/updateAlbum")
    public void updateAlbum(CmfzAlbum album){
        albumService.update(album);
    }

    @RequestMapping("/deleteMany")
    public void deleteMany(int[] ids){
        albumService.deleteMore(ids);
    }

}
